Add guardrails hard rules recipe#135
Open
webchick wants to merge 6 commits into
Open
Conversation
Adds a Claude Code slash command that analyzes an external GitHub repo, identifies AI/Temporal patterns worth extracting as cookbook recipes, and generates complete recipe scaffolds in the standard format. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cookbook targets AI engineers who know LLMs but are new to Temporal. Recipes should teach agent patterns (loops, tool use, structured output, multi-agent, human-in-loop) with Temporal as the invisible durability layer — not Temporal infrastructure patterns like workflow deduplication or heartbeats. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds patterns from the AI Cookbook wishlist (RAG, streaming, memory, guardrails, chain-of-thought, cost tracking, etc.) and a coverage-gap check so recipe proposals are ranked higher when they fill a known hole. Also adds a 'well-engineered, not a demo' quality filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the thin name+description proposals with structured proposal cards: problem statement, source code excerpt, recipe structure sketch, diff from nearest existing recipe, wishlist gap, and size estimate. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
recipe-scout: analyzes a GitHub repo and produces reviewer-ready proposal cards — no files written, just structured recommendations. recipe-ify: takes a pattern description (or proposal card) and generates the complete recipe — all files, runnable, PR-ready. Can be used standalone without recipe-scout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Demonstrates a post-LLM guardrail layer that uses deterministic hard rules to override an LLM's content moderation verdict, ensuring policy-critical decisions cannot be bypassed by hallucination or prompt injection. The LLM's original reasoning is preserved inside any override so decisions remain auditable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agents/guardrails_hard_rules_python/— a new recipe demonstrating the post-LLM guardrail patternsafe/review/block; deterministic hard rules can override toblockregardless of what the LLM saidWhat it teaches
The core insight: for any decision with real consequences, you shouldn't rely on the LLM alone. Hard rules catch unambiguous violations deterministically; the LLM handles the grey zone. This recipe shows how to layer the two cleanly — and how to preserve auditability when the deterministic layer wins.
Fills the Guardrails gap from the cookbook wishlist. Sourced from the
classifiers/_helpers.pypattern in dependency-scout, simplified to a generic content moderation scenario.Recipe structure
Test plan
uv run pytest tests/ --timeout=30→ 10/10 passing, no API key neededANTHROPIC_API_KEY=... uv run python -m worker+uv run python -m start_workflow— verify output matches README🤖 Generated with Claude Code